<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String basePath = request.getScheme() + "://" + request.getServerName()
			+ ":" + request.getServerPort() + request.getContextPath();
%>
<jsp:include page="/WEB-INF/page/auth/_header.jsp"></jsp:include>
<body>
	<jsp:include page="/WEB-INF/page/auth/header.jsp"></jsp:include>
	<div id="middle">
		<jsp:include page="/WEB-INF/page/auth/menu.jsp"></jsp:include>
		<div id="right">
			<div id="class_teachertb">
		        <form id="class_teacherForm" class="mt10 ml10">
		           	 年级：
		            <select class="form-control1" name="grade" id="grade"></select>
		            <a class="easyui-linkbutton l-btn l-btn-small" data-options="iconCls:'icon-search'" onclick="searchForm('class_teacher')">查询</a>
		        </form>
		    </div>
		    <table id="class_teacherdg">
		        <thead>
		            <tr>
		                <th data-options="field:'id',checkbox:true">ID</th>
		                <th data-options="field:'grade',title:'年级号',width:10,editor:{
		                    type:'combobox',
		                    options:{
		                        editable:false,
		                        required:true,
		                        url:'<%=basePath %>/gradeCombo'
		                    }
		                },formatter:function(value,row,index){
		                    return row.gradeName;
		                }"></th>
		                <th data-options="field:'clazz',title:'班号',
			                editor:{
			                    type:'numberbox',
			                    options:{required:true}
			                }"></th>
		                <th data-options="field:'classTeacherId',title:'班主任',width:10,
			                editor:{
			                    type:'combobox',
			                    options:{
			                        valueField:'id',
			                        textField:'name',
			                        method:'POST',
			                        url: '<%=basePath %>/common/teacherList',
			                        required:true
			                    }
			                },formatter:function(value,row,index){
			                    return row.classTeacher;
			                }"></th>
			                <th data-options="field:'chineseTeacherId',width:10,title:'语文',
			                editor:{
			                    type:'combobox',
			                    options:{
			                        valueField:'id',
			                        textField:'name',
			                        method:'POST',
			                        url: '<%=basePath %>/common/teacherList',
			                        required:true
			                    }
			                },formatter:function(value,row,index){
			                    return row.chineseTeacher;
			                }"></th>
			                <th data-options="field:'mathTeacherId',width:10,title:'数学',
			                editor:{
			                    type:'combobox',
			                    options:{
			                        valueField:'id',
			                        textField:'name',
			                        method:'POST',
			                        url: '<%=basePath %>/common/teacherList',
			                        required:true
			                    }
			                },formatter:function(value,row,index){
			                    return row.mathTeacher;
			                }"></th>
			                <th data-options="field:'englishTeacherId',width:10,title:'英语',
			                editor:{
			                    type:'combobox',
			                    options:{
			                        valueField:'id',
			                        textField:'name',
			                        method:'POST',
			                        url: '<%=basePath %>/common/teacherList',
			                        required:true
			                    }
			                },formatter:function(value,row,index){
			                    return row.englishTeacher;
			                }"></th>
			                <th data-options="field:'lifeTeacherId',width:10,title:'生活老师',
			                editor:{
			                    type:'combobox',
			                    options:{
			                        valueField:'id',
			                        textField:'name',
			                        method:'POST',
			                        url: '<%=basePath %>/common/teacherList'
			                    }
			                },formatter:function(value,row,index){
			                    return row.lifeTeacher;
			                }"></th>
			                <th data-options="field:'deputyClassTeacherId',width:10,title:'副班主任',
			                editor:{
			                    type:'combobox',
			                    options:{
			                        valueField:'id',
			                        textField:'name',
			                        method:'POST',
			                        url: '<%=basePath %>/common/teacherList'
			                    }
			                },formatter:function(value,row,index){
			                    return row.deputyClassTeacher;
			                }"></th>
		            </tr>
		        </thead>
		    </table>
		</div>
	</div>
	<jsp:include page="/WEB-INF/page/auth/_footer.jsp"/>
    <script type="text/javascript">
        $(function(){
            var url = basePath + "/sys/classTeacher";
            initDatagridAdmin("class_teacher",url,1,1,1,1,0);
            initGrade("class_teacher");
        })
    </script>
</body>
</html>